package com.example.demo.entity.request.repository;

import com.example.demo.common.entity.request.BaseRequest;
import com.example.demo.common.entity.enums.RepositoryTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;

/**
 * 仓库请求对象.
 *
 * @author Mei Ruoxiao
 * @since 2020/9/15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel("仓库请求对象")
public class RepositoryRequest extends BaseRequest {

    @NotEmpty(message = "名称不能为空")
    @Length(message = "名称不能超过{max}个字符", max = 50)
    @ApiModelProperty(value = "名称", required = true, example = "芯片仓库")
    private String name;
    /**
     * {@link RepositoryTypeEnum#value()}
     */
    @ApiModelProperty(value = "父节点ID, 默认1", example = "1")
    private Long parentId;

    @ApiModelProperty(value = "文件夹类型 0-材料 1-成品 2-废品", example = "0")
    private int type;

}
